﻿using Elves.State;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ElvesBody : MonoBehaviour
{
    
    public ElvesData ElvesData;
    public ElvesStatus ElvesStatus;
    public PlayerBody Player;

    public Rigidbody2D rigidbody;

    private ElvesOrder currentOrder;

    public void Init()
    {

    }

    private void Start()
    {
        if (Player == null)
            Player = GameObject.FindGameObjectWithTag("Player").GetComponent<PlayerBody>();
        ElvesStatus = new ElvesStatus();
        ElvesData = new ElvesData();

        currentOrder = ElvesOrder.Attack;
        rigidbody = GetComponent<Rigidbody2D>();
    }


    public void OrderElves(ElvesOrder order)
    {
        currentOrder = order;
        switch (order)
        {
            case ElvesOrder.Attack:
                ElvesStatus.isProtect = false;
                ElvesStatus.isSkill = false;
                break;
            case ElvesOrder.Protect:
                ElvesStatus.isProtect = true;
                ElvesStatus.isSkill = false;
                break;
            case ElvesOrder.Skill:
                ElvesStatus.isProtect = false;
                ElvesStatus.isSkill = true;
                break;
            default:
                break;
        }
    }
}
